package com.william.jdbcplus.core.enums;

import com.william.jdbcplus.core.conditions.segment.ISegment;
import com.william.jdbcplus.core.toolkit.StringPool;

/**
 * SQL 保留关键字枚举
 */
public enum SqlKeyword implements ISegment {
    ON("on"),
    AS("as"),
    AND("and"),
    OR("or"),
    IN("in"),
    NOT("not"),
    LIKE("like"),
    NOTLIKE("not like"),
    EQ(StringPool.EQUALS),
    NE("<>"),
    GT(StringPool.RIGHT_CHEV),
    GE(">="),
    LT(StringPool.LEFT_CHEV),
    LE("<="),
    IS_NULL("is null"),
    IS_NOT_NULL("is not null"),
    SELECT("select"),
    DISTINCT("distinct"),
    COUNT("count"),
    COUNT_ONE("count(1)"),
    DELETE("delete"),
    UPDATE("update"),
    SET("set"),
    FROM("from"),
    WHERE("where"),
    GROUP_BY("group by"),
    HAVING("having"),
    ORDER_BY("order by"),
    EXISTS("exists"),
    BETWEEN("between"),
    ASC("asc"),
    DESC("desc"),
    SUM("sum"),
    AVG("avg"),
    MAX("max"),
    MIN("min"),
    ONE("1"),
    FALSE("1=0"),
    TRUE("1=1"),
    LOWER("lower"),
    UNION("union"),
    UNION_All("union all"),
    JOIN("join"),
    INNER_JOIN("inner join"),
    LEFT_JOIN("left join"),
    RIGHT_JOIN("right join"),
    FULL_JOIN("full join"),
    LEFT_BRACKET("("),
    RIGHT_BRACKET(")");

    private final String keyword;

    SqlKeyword(final String keyword) {
        this.keyword = keyword;
    }

    @Override
    public String getSegment() {
        return this.keyword;
    }

    @Override
    public String toString() {
        return this.keyword;
    }
}
